<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="ListServlet" method="post">
		饭店名称:<input type="text" name="fname" value="${fname }">
		菜系:<select name="cid">
			<option value="">请选择</option>
			<option value="1" ${cid==1?'selected':'' }>川菜</option>
			<option value="2" ${cid==2?'selected':'' }>粤菜</option>
			<option value="3" ${cid==3?'selected':'' }>鲁菜</option>
			<option value="4" ${cid==4?'selected':'' }>湘菜</option>
			<option value="5" ${cid==5?'selected':'' }>浙菜</option>
		</select>
		<input type="submit" value="查询">
	</form>
	<a href="Add.jsp">添加</a>
	<table border="1" >
		<tr>
			<td>编号</td>
			<td>饭店名称</td>
			<td>简介</td>
			<td>地址</td>
			<td>营业日期</td>
			<td>菜系</td>
			<td>状态</td>
			<td>操作</td>
		</tr>
		<c:forEach items="${list }" var="list">
			<tr>
				<td>${list.id }</td>
				<td>${list.name }</td>
				<td>${list.description }</td>
				<td>${list.address }</td>
				<td>${list.opening_time }</td>
				<td>${list.cname }</td>
				<td>${list.state==0?'休息中':'营业中' }</td>
				<td>
					<a href="ToServlet?id=${list.id }">修改</a>
					<a href="UpdatestateServlet?id=${list.id }&state=0">${list.state==1?'休息':'' }</a>
					<a href="UpdatestateServlet?id=${list.id }&state=1">${list.state==0?'营业':'' }</a>
					<a href="DelServlet?id=${list.id }">删除</a>
				</td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>